treewide: move executables to /sbin
In firewall3, the fw3 executable is installed in /sbin. As
luci-app-firewall looks for the fw3 executable in /sbin, the firewall
menu is hidden when firewall4 is installed. Move both executables to
/sbin so the firewall app will show when firewall4 is installed.
Signed-off-by: Stijn Tintel <[email protected]>
Reviewed-by: Jo-Philipp Wich <[email protected]>
fw4.uc: Do not quote port ranges
This fixes the translation of rules like the following:
config rule
...
option dest_port '67:68'
Signed-off-by: Thomas Weißschuh <[email protected]>
tests: adapt test to new ICMP print logic
Fixes: 35f5120afcf158e445062fdb5072684ed24d91d0
Signed-off-by: Thomas Weißschuh <[email protected]>
rule.uc: always format ICMP type/code list as set
Ensure that the concatenated type . code list values are always formatted
as anonymous set, even if the list just contains one item. Fixes the
following nftables error when parsing such a rule:
Error: Use concatenations with sets and maps, not singleton values
Signed-off-by: Jo-Philipp Wich <[email protected]>
treewide: convert deprecated syntax
- `local` has been deprecated in favor to `let`
- `delete(obj, "prop")` has been depracted in favor to `delete obj.prop`
Signed-off-by: Jo-Philipp Wich <[email protected]>
tests: adapt to latest ucode
- Environment must be set before preloading and executing modules
- Caching of fs module must be inhibited
- Mocklib class object should be returned
Signed-off-by: Jo-Philipp Wich <[email protected]>
tests: expand testing
- Rewrite test framework
- Add initial rule test coverage
Signed-off-by: Jo-Philipp Wich <[email protected]>
fw4.uc: fix family test functions
Rewrite the family test functions as arrow functions since ucode HEAD does
implicitly return the last function value expression as result anymore for
ordinary functions.
Signed-off-by: Jo-Philipp Wich <[email protected]>
fw4.uc: fix parsing boolean "0" values
Signed-off-by: Jo-Philipp Wich <[email protected]>
rule.uc: fix redundant whitespace in rules without target
Signed-off-by: Jo-Philipp Wich <[email protected]>
ruleset.uc: reduce empty lines in output
Signed-off-by: Jo-Philipp Wich <[email protected]>
fw4.uc: gracefully handle missing defaults section
Signed-off-by: Jo-Philipp Wich <[email protected]>
treewide: remove ucode module preloading
Instead of preloading ucode modules via the cmdline, require the modules
as needed. This simplifies test case constructions since mock modules
can be injected by modifying the search path.
Signed-off-by: Jo-Philipp Wich <[email protected]>
fw4.uc: remove upvalue caching
Now that ucode HEAD inherits the global scope in include() by default, we
do not need to cache our used functions anymore.
Signed-off-by: Jo-Philipp Wich <[email protected]>